package com.zt.java.proxy;


public class TestMyProxyFactory {

    public static void main(String[] args) {
        Person target = new XiaoYuEr();
        InterceptorChain interceptorChain = new InterceptorChain();
        OneInterceptor oneInterceptor = new OneInterceptor();
        AnotherInterceptor anotherInterceptor = new AnotherInterceptor(oneInterceptor);
        interceptorChain.setFirst(anotherInterceptor);
        Person person = (Person)new ProxyFactory(target, interceptorChain).getProxy();
        person.eat();
    }

}
